// xxresult internal header
// NOTE: no include guard

#define _RESULT_TYPE _CLASS_NAME(_Result_type)
#define _RESULT_OF _CLASS_NAME(_Result_of)

// TEMPLATE CLASS _Result_typeX
template<bool,
	class _Fty
	_C_CLASS_ARG0>
	struct _RESULT_TYPE;

template<class _Fty
	_C_CLASS_ARG0>
	struct _RESULT_TYPE<true, _Fty _C_ARG0_ARG1>
	{	// define return type for UDT with nested type named result_type
	typedef typename _Fty::result_type _Type;
	};

template<class _Fty
	_C_CLASS_ARG0>
	struct _RESULT_TYPE<false, _Fty _C_ARG0_ARG1>
	{	// define return type for UDT without nested type named result_type

 #if _NARGS == 0
	typedef void _Type;

 #else /* _NARGS */
	typedef typename _Fty::template result<_Fty(_ARG0_ARG1)>::type _Type;
 #endif /* _NARGS */

	};

	// TEMPLATE CLASS _Result_of
template<class _Fty
	_C_CLASS_FARG0>
	struct _RESULT_OF
	{	// UDT
	static const bool _Value = _HAS_RESULT_TYPE(_Fty);
	typedef typename _RESULT_TYPE<
		_RESULT_OF<_Fty _C_FARG0_FARG1>::_Value,
		_Fty _C_FARG0_FARG1>::_Type _Type;
	};

template<class _Ret
	_C_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Ret(&)(_ARG0_ARG1) _C_FARG0_FARG1>
	{	// reference to function
	typedef _Ret _Type;
	};

template<class _Ret
	_C_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Ret(*)(_ARG0_ARG1) _C_FARG0_FARG1>
	{	// pointer to function
	typedef _Ret _Type;
	};

template<class _Ret
	_C_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Ret(* const)(_ARG0_ARG1) _C_FARG0_FARG1>
	{	// const pointer to function
	typedef _Ret _Type;
	};

 #if _NARGS == 1
template<class _Rx,
	class _Arg0,
	class _Farg0>
	struct _RESULT_OF<_Rx _Arg0::*, _Farg0&>
	{	// pointer to member data
	typedef typename _Copy_cv<_Rx, _Farg0&>::_Type _Type;
	};

template<class _Rx,
	class _Arg0,
	class _Farg0>
	struct _RESULT_OF<_Rx _Arg0::*const, _Farg0&>
	{	// pointer to member data
	typedef typename _Copy_cv<_Rx, _Farg0&>::_Type _Type;
	};
 #endif /* _NARGS == 1 */

 #if _NARGS != 0
	// TEMPLATE FUNCTION _RESULT_OF, pointer to member fn
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__thiscall _Arg0::*)(_ARG1_ARG2),
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to member fn
	typedef _Rx _Type;
	};

 #ifdef _M_IX86
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__cdecl _Arg0::*)(_ARG1_ARG2),
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to member fn
	typedef _Rx _Type;
	};

template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__stdcall _Arg0::*)(_ARG1_ARG2),
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to member fn
	typedef _Rx _Type;
	};

  #ifndef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__fastcall _Arg0::*)(_ARG1_ARG2),
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to member fn
	typedef _Rx _Type;
	};
  #endif /* _M_CEE */
 #endif /* _M_IX86 */

 #ifdef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__clrcall _Arg0::*)(_ARG1_ARG2),
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to member fn
	typedef _Rx _Type;
	};
 #endif /* _M_CEE */

	// TEMPLATE FUNCTION _RESULT_OF, pointer to const member fn
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__thiscall _Arg0::*)(_ARG1_ARG2) const,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to const member fn
	typedef _Rx _Type;
	};

 #ifdef _M_IX86
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__cdecl _Arg0::*)(_ARG1_ARG2) const,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to const member fn
	typedef _Rx _Type;
	};

template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__stdcall _Arg0::*)(_ARG1_ARG2) const,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to const member fn
	typedef _Rx _Type;
	};

  #ifndef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__fastcall _Arg0::*)(_ARG1_ARG2) const,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to const member fn
	typedef _Rx _Type;
	};
  #endif /* _M_CEE */
 #endif /* _M_IX86 */

 #ifdef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__clrcall _Arg0::*)(_ARG1_ARG2) const,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to const member fn
	typedef _Rx _Type;
	};
 #endif /* _M_CEE */

	// TEMPLATE FUNCTION _RESULT_OF, pointer to volatile member fn
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__thiscall _Arg0::*)(_ARG1_ARG2) volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to volatile member fn
	typedef _Rx _Type;
	};

 #ifdef _M_IX86
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__cdecl _Arg0::*)(_ARG1_ARG2) volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to volatile member fn
	typedef _Rx _Type;
	};

template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__stdcall _Arg0::*)(_ARG1_ARG2) volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to volatile member fn
	typedef _Rx _Type;
	};

  #ifndef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__fastcall _Arg0::*)(_ARG1_ARG2) volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to volatile member fn
	typedef _Rx _Type;
	};
  #endif /* _M_CEE */
 #endif /* _M_IX86 */

 #ifdef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__clrcall _Arg0::*)(_ARG1_ARG2) volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to volatile member fn
	typedef _Rx _Type;
	};
 #endif /* _M_CEE */

	// TEMPLATE FUNCTION _RESULT_OF, pointer to const volatile member fn
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__thiscall _Arg0::*)(_ARG1_ARG2) const volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to const volatile member fn
	typedef _Rx _Type;
	};

 #ifdef _M_IX86
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__cdecl _Arg0::*)(_ARG1_ARG2) const volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to const volatile member fn
	typedef _Rx _Type;
	};

template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__stdcall _Arg0::*)(_ARG1_ARG2) const volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to const volatile member fn
	typedef _Rx _Type;
	};

  #ifndef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__fastcall _Arg0::*)(_ARG1_ARG2) const volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to const volatile member fn
	typedef _Rx _Type;
	};
  #endif /* _M_CEE */
 #endif /* _M_IX86 */

 #ifdef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__clrcall _Arg0::*)(_ARG1_ARG2) const volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// pointer to const volatile member fn
	typedef _Rx _Type;
	};
 #endif /* _M_CEE */

	// TEMPLATE FUNCTION _RESULT_OF, const pointer to member fn
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__thiscall _Arg0::*const)(_ARG1_ARG2),
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to member fn
	typedef _Rx _Type;
	};

 #ifdef _M_IX86
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__cdecl _Arg0::*const)(_ARG1_ARG2),
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to member fn
	typedef _Rx _Type;
	};

template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__stdcall _Arg0::*const)(_ARG1_ARG2),
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to member fn
	typedef _Rx _Type;
	};

  #ifndef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__fastcall _Arg0::*const)(_ARG1_ARG2),
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to member fn
	typedef _Rx _Type;
	};
  #endif /* _M_CEE */
 #endif /* _M_IX86 */

 #ifdef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__clrcall _Arg0::*const)(_ARG1_ARG2),
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to member fn
	typedef _Rx _Type;
	};
 #endif /* _M_CEE */

	// TEMPLATE FUNCTION _RESULT_OF, const pointer to const member fn
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__thiscall _Arg0::*const)(_ARG1_ARG2) const,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to const member fn
	typedef _Rx _Type;
	};

 #ifdef _M_IX86
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__cdecl _Arg0::*const)(_ARG1_ARG2) const,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to const member fn
	typedef _Rx _Type;
	};

template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__stdcall _Arg0::*const)(_ARG1_ARG2) const,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to const member fn
	typedef _Rx _Type;
	};

  #ifndef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__fastcall _Arg0::*const)(_ARG1_ARG2) const,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to const member fn
	typedef _Rx _Type;
	};
  #endif /* _M_CEE */
 #endif /* _M_IX86 */

 #ifdef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__clrcall _Arg0::*const)(_ARG1_ARG2) const,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to const member fn
	typedef _Rx _Type;
	};
 #endif /* _M_CEE */

	// TEMPLATE FUNCTION _RESULT_OF, const pointer to volatile member fn
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__thiscall _Arg0::*const)(_ARG1_ARG2) volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to volatile member fn
	typedef _Rx _Type;
	};

 #ifdef _M_IX86
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__cdecl _Arg0::*const)(_ARG1_ARG2) volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to volatile member fn
	typedef _Rx _Type;
	};

template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__stdcall _Arg0::*const)(_ARG1_ARG2) volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to volatile member fn
	typedef _Rx _Type;
	};

  #ifndef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__fastcall _Arg0::*const)(_ARG1_ARG2) volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to volatile member fn
	typedef _Rx _Type;
	};
  #endif /* _M_CEE */
 #endif /* _M_IX86 */

 #ifdef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__clrcall _Arg0::*const)(_ARG1_ARG2) volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to volatile member fn
	typedef _Rx _Type;
	};
 #endif /* _M_CEE */

	// TEMPLATE FUNCTION _RESULT_OF, const pointer to const volatile member fn
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__thiscall _Arg0::*const)(_ARG1_ARG2) const volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to const volatile member fn
	typedef _Rx _Type;
	};

 #ifdef _M_IX86
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__cdecl _Arg0::*const)(_ARG1_ARG2) const volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to const volatile member fn
	typedef _Rx _Type;
	};

template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__stdcall _Arg0::*const)(_ARG1_ARG2) const volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to const volatile member fn
	typedef _Rx _Type;
	};

  #ifndef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__fastcall _Arg0::*const)(_ARG1_ARG2) const volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to const volatile member fn
	typedef _Rx _Type;
	};
  #endif /* _M_CEE */
 #endif /* _M_IX86 */

 #ifdef _M_CEE
template<class _Rx,
	_CLASS_ARG0
	_C_CLASS_FARG0>
	struct _RESULT_OF<_Rx (__clrcall _Arg0::*const)(_ARG1_ARG2) const volatile,
		_Farg0& _C_FARG1_FARG2>
	{	// const pointer to const volatile member fn
	typedef _Rx _Type;
	};
 #endif /* _M_CEE */
 #endif /* _NARGS != 0 */

	// TEMPLATE CLASS _Result_of
template<class _Fty
	_C_CLASS_ARG0>
	struct _Result_of<_Fty __cdecl (_ARG0_ARG1)>
	{	// generic result_of
	typedef typename _RESULT_OF<_Fty _C_ARG0_ARG1_TO_REF>::_Type _Type;
	};

 #ifdef _M_CEE
template<class _Fty
	_C_CLASS_ARG0>
	struct _Result_of<_Fty __clrcall (_ARG0_ARG1)>
	{	// generic result_of
	typedef typename _RESULT_OF<_Fty _C_ARG0_ARG1_TO_REF>::_Type _Type;
	};
 #endif /* _M_CEE */

#undef _RESULT_OF
#undef _RESULT_TYPE

/*
 * Copyright (c) 1992-2008 by P.J. Plauger.  ALL RIGHTS RESERVED.
 * Consult your license regarding permissions and restrictions.
V5.05:0009 */
